<?php
/**
 * Created by PhpStorm.
 * User: Tomkk
 * Date: 2016/5/1
 * Time: 23:31
 */

/*
 CREATE TABLE php.specialties
(
    id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
    specialty_name VARCHAR(30) NOT NULL,
    college_id INT NOT NULL,
    isuse BOOL DEFAULT TRUE  NOT NULL,
    CONSTRAINT specialties_colleges_id_fk FOREIGN KEY (id) REFERENCES colleges (id) ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE UNIQUE INDEX specialties_id_uindex ON php.specialties (id);

ALTER TABLE php.specialties MODIFY COLUMN specialty_name VARCHAR(255)
CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
*/
require 'result.php';

$mysqli = new mysqli("localhost:3306","root","root",'php');
mysqli_query($mysqli,"set names utf8;");//需要添加这一句解决从PHP读出数据乱码的问题
if (!$mysqli)
{
    die (error(1,'连接数据库失败'));
}


